#c++ array
Explore tagged Tumblr posts
doctahchang · 1 year ago
Text
obsessed with the fact that chakotay's maquis ship was called 'val jean'. are all maquis obsessed with les mis. was it an obligatory read. did the guy name it himself. why the spelling error. did he secretly ship javert and valjean. because that would explain a lo- [gunshot]
37 notes · View notes
bielobog-kun · 4 months ago
Text
Tumblr media
i swear to god i am testing code for an actual meaningful project it just looks like im goofing off though
5 notes · View notes
orcelito · 3 months ago
Text
Got jumpscared by my own full legal name showing up in my email notifications bc I forgot I emailed my code to myself today just in case my VM ends up stopping working again (I got nervous & didn't wanna lose my progress lol)
Goldfish level memory retention
& the funny thing is that the email itself is just. This
Tumblr media
Full Legal Name code • hi
#speculation nation#title 'code' email is just 'hi'. with the .c file attached of course#honestly i had a very productive day in lab today. i got the core structure of the program down and made sure it all worked#testing it with One of the sorting algorithms. and it worked!!#the lab is to code functions for different kinds of sorts. like bubble sort selection sort and uhh. some other shit idr rn#and have the functions take timestamps from before and after they run the sorts to calculate the elapsed time#and we have to run this for array sizes of like. 10 50 500 etc etc up to like 50000 or smth? if i remember right.#and then once all that's done we take the output and graph the time elapsed for each type of sort/search per array sizes#so today at lab i made the random array generator function. a swap function. the execution function. bubble sort. and main.#main calls the execution function passing in the array sizes. execution(10); execution(50); etc#execution defines the array of that size. then calls the random number generator to populate the array. then passes it to the sort functions#tested with my one bubble sort function. which finished in like 0.00003 seconds or smth for array size 10#BUT taking the time stamps was tricky. there are a lot of ways to do that. and time(); in c is in full seconds#i ended up asking the TA if he had a recommendation for what to use bc theres a LOT of time functions out there#and full seconds isnt precise enough for this purpose. & he recommended clock()!!#records number of clock ticks which is NOT the same as seconds. but when u divide it by uh. forgetting it rn but it's a constant#that will turn it into actual seconds. clock tics per sec?? smth like that.#so anyways very productive 👍 i just need to set main up to call execution function for all the different array sizes#and then write all the functions for the different sorts/searches. but i have the core structure down with the bubble sort function#(specifically with the time stamps and the print function after) that i will copy-paste for all the other functions#and then inside them i put the basic code. none of it's complicated. all can be found on the internet easy.#SO!!!!! honestly i think itd take me less than an hour to finish. tho plotting out that graph is going to be annoying#something like 6 sizes per 5 sort/search functions. painstakingly copy pasting each one into excel or smth lol#but yea im content with how much ive gotten done. yippee!!!!#now i just need to finish my web programming lab before sunday night. blehhhhh
2 notes · View notes
watchmorecinema · 2 years ago
Text
Normally I just post about movies but I'm a software engineer by trade so I've got opinions on programming too.
Apparently it's a month of code or something because my dash is filled with people trying to learn Python. And that's great, because Python is a good language with a lot of support and job opportunities. I've just got some scattered thoughts that I thought I'd write down.
Python abstracts a number of useful concepts. It makes it easier to use, but it also means that if you don't understand the concepts then things might go wrong in ways you didn't expect. Memory management and pointer logic is so damn annoying, but you need to understand them. I learned these concepts by learning C++, hopefully there's an easier way these days.
Data structures and algorithms are the bread and butter of any real work (and they're pretty much all that come up in interviews) and they're language agnostic. If you don't know how to traverse a linked list, how to use recursion, what a hash map is for, etc. then you don't really know how to program. You'll pretty much never need to implement any of them from scratch, but you should know when to use them; think of them like building blocks in a Lego set.
Learning a new language is a hell of a lot easier after your first one. Going from Python to Java is mostly just syntax differences. Even "harder" languages like C++ mostly just mean more boilerplate while doing the same things. Learning a new spoken language in is hard, but learning a new programming language is generally closer to learning some new slang or a new accent. Lists in Python are called Vectors in C++, just like how french fries are called chips in London. If you know all the underlying concepts that are common to most programming languages then it's not a huge jump to a new one, at least if you're only doing all the most common stuff. (You will get tripped up by some of the minor differences though. Popping an item off of a stack in Python returns the element, but in Java it returns nothing. You have to read it with Top first. Definitely had a program fail due to that issue).
The above is not true for new paradigms. Python, C++ and Java are all iterative languages. You move to something functional like Haskell and you need a completely different way of thinking. Javascript (not in any way related to Java) has callbacks and I still don't quite have a good handle on them. Hardware languages like VHDL are all synchronous; every line of code in a program runs at the same time! That's a new way of thinking.
Python is stereotyped as a scripting language good only for glue programming or prototypes. It's excellent at those, but I've worked at a number of (successful) startups that all were Python on the backend. Python is robust enough and fast enough to be used for basically anything at this point, except maybe for embedded programming. If you do need the fastest speed possible then you can still drop in some raw C++ for the places you need it (one place I worked at had one very important piece of code in C++ because even milliseconds mattered there, but everything else was Python). The speed differences between Python and C++ are so much smaller these days that you only need them at the scale of the really big companies. It makes sense for Google to use C++ (and they use their own version of it to boot), but any company with less than 100 engineers is probably better off with Python in almost all cases. Honestly thought the best programming language is the one you like, and the one that you're good at.
Design patterns mostly don't matter. They really were only created to make up for language failures of C++; in the original design patterns book 17 of the 23 patterns were just core features of other contemporary languages like LISP. C++ was just really popular while also being kinda bad, so they were necessary. I don't think I've ever once thought about consciously using a design pattern since even before I graduated. Object oriented design is mostly in the same place. You'll use classes because it's a useful way to structure things but multiple inheritance and polymorphism and all the other terms you've learned really don't come into play too often and when they do you use the simplest possible form of them. Code should be simple and easy to understand so make it as simple as possible. As far as inheritance the most I'm willing to do is to have a class with abstract functions (i.e. classes where some functions are empty but are expected to be filled out by the child class) but even then there are usually good alternatives to this.
Related to the above: simple is best. Simple is elegant. If you solve a problem with 4000 lines of code using a bunch of esoteric data structures and language quirks, but someone else did it in 10 then I'll pick the 10. On the other hand a one liner function that requires a lot of unpacking, like a Python function with a bunch of nested lambdas, might be easier to read if you split it up a bit more. Time to read and understand the code is the most important metric, more important than runtime or memory use. You can optimize for the other two later if you have to, but simple has to prevail for the first pass otherwise it's going to be hard for other people to understand. In fact, it'll be hard for you to understand too when you come back to it 3 months later without any context.
Note that I've cut a few things for simplicity. For example: VHDL doesn't quite require every line to run at the same time, but it's still a major paradigm of the language that isn't present in most other languages.
Ok that was a lot to read. I guess I have more to say about programming than I thought. But the core ideas are: Python is pretty good, other languages don't need to be scary, learn your data structures and algorithms and above all keep your code simple and clean.
20 notes · View notes
sw5w · 2 years ago
Text
Probe Droids Summoned
Tumblr media
STAR WARS EPISODE I: The Phantom Menace 00:51:53
I added a bit of speculation to this, as the area above the engines appears to be a sealed rear viewport when compared with the shape of the front viewport. It would also correspond with the passenger seating in the cockpit (though the illustration shows the shape disconnected)
Tumblr media Tumblr media Tumblr media Tumblr media
2 notes · View notes
theweirdmasquerade · 2 years ago
Text
gale, sir, I am not sure why you thought at *any* point that aris was flirting with you but I am glad you finally got the picture
3 notes · View notes
herovired12 · 4 months ago
Text
One-dimensional arrays in C are data structures that store a collection of elements of the same type in a linear format. Each element is accessed using its index, starting from zero. They provide efficient memory usage and are useful for storing lists, such as integers or characters, facilitating easy data manipulation. Check here to learn more.
0 notes
yippee-ki-yoyo · 8 months ago
Text
.
0 notes
ayuranslounge · 9 months ago
Text
Alright folks, we have a bunch of binary in this file which will be used as binary. No need to transform, just pass it to the gpu so it can do its thing.
How should we read the file and store the data? Char vector. Because that's the only way you can output file reads.
Yes this makes sense.
This is why the guy was losing his mind for years trying to get c++ to accept embeding files into programs.
1 note · View note
himejoshibutch · 9 months ago
Text
tech mutuals/followers i need some help...
i almost finished c programming so...
0 notes
engenhariadesoftware · 10 months ago
Text
C# Programming Challenge: Student Registration System
Welcome to this programming challenge designed for beginners in C#. In this exercise, you’ll create a simple student registration system. This challenge will help you practice fundamental programming concepts such as handling user input, working with lists, and using basic control structures. Challenge Description You are tasked with developing a basic console application for a school that…
0 notes
humanjarvis · 4 months ago
Text
road trip
Tumblr media
synopsis: you get revenge on caleb during his graduation trip.
tags: nsfw (mdni), semi-public sex, dry humping, caleb fucks around (figuratively) and finds out, caleb/mc are intimate before homecoming wings, caleb whimpers, caleb wheezes, caleb begs, caleb is pathetic, caleb comes in his pants while mc ignores him  pairing: caleb x reader, reader is mc but uses y/n word count: 968
a/n: i literally got up at 8 am on a sunday to write this i am not well 
Tumblr media
As excited as you’d been to commemorate Caleb's last year of college, his graduation trip to the aerospace museum was off to a rocky start. 
Last night, he’d suddenly shut down your plans to celebrate your friend’s birthday before you went out of town, joining his friends’ road trip as his plus-one. He’d said you needed to get some rest before your 8-hour journey, but with the way his eyes went wide and nostrils flared when he saw your outfit, you knew that wasn’t the only reason. 
You’d spent the rest of the night and the next morning angry, and it only got worse when Caleb’s friends came to pick you up. One extra person had decided to come last-minute, meaning there weren’t enough seats for all of you, no matter how tightly you squeezed together. 
As the closest pair in the group, you were forced to sit on Caleb's lap. You’d seethed in unprecedented indignation as he guided you down on him, the scowl on your face widening the smirk on his. 
An hour into the drive, you’re still staring out the window in rage, Caleb's arms secured tightly around you, when you realize something. You know this route. You’d traveled it a couple years prior for your senior trip in high school on the way to some world-renowned aquarium. 
At your realization, your frustration turns into opportunity. The roads on this route are a pothole-ridden nightmare from years of government neglect, and you’re going to use this intel to make Caleb pay. 
Discreetly, you slide yourself further back on his legs, positioning your ass right over his crotch. You conceal your movements through a conversation with Gideon’s girlfriend that you bring to an abrupt end once you’re settled. It’s time for your game to begin. 
At first, you’re subtle. Matching the rhythm of the bumpy ride, you lightly jostle in Caleb’s hold, feeling his fingers flex around your waist. 
“Careful, pipsqueak,” he murmurs in warning. “Wouldn’t want you sliding off.” 
You don’t respond. Your earlier anger is the perfect excuse not to acknowledge him through this entire thing, and you silently bless your short temper. He’s going to unravel with your back turned, you facing forward, your eyes on everything but him. 
When the car hits a small pothole, you lean back into him, “innocently” grinding your ass into his crotch. Immediately, Caleb wheezes behind you, almost concussing both of you the way he falls forward in shock. 
“What are you doing,” he hisses when he recovers, his words more an admonishment than a question. 
Resolutely, you pay him no mind, striking up a group discussion about the museum. What kinds of planes do they have there? How big is it? Have any of you ever been? And all the while, you continue tormenting the man beneath you, using the cavities of the road to assist. 
On one particularly sharp turn, you grind your hips into him a little harder, feeling the outline of his bulge between your legs. At this point, Caleb has caught on. Taking heaving breaths, he leans into your shoulder with a soft groan, muttering, “Don’t do this to me, Y/N. Not here, please.”
As he whispers into your ear, his absence from the larger conversation takes center stage. “You alright back there, Caleb?” Gideon calls from the driver’s seat. “Need any water? A/C?” 
“I’m fine,” Caleb grits out, barely managing to mask his grunt. 
Smiling to yourself, you adjust on his lap as you peer through the windshield, taking in the busy scene ahead of you. There’s some kind of festival going on, it seems, and half the street is blocked by a colorful array of vehicles. The lack of space forces Gideon’s full-size SUV onto the gravelly edge of the road.
Perfect, you think. Time for the grand finale. 
Bracing your hands on Caleb's thighs for support, you let the rest of your body go limp, leaving yourself completely at the mercy of the rocks ruining Gideon’s paint job. Up and down, up and down, up and down you went, virtually bouncing on Caleb’s growing erection. 
“Please,” he whimpers into your ear, not daring to speak above a whisper. Another bounce, and his hands are grasping at your hips while he throws his head back, jaw clenched shut. 
Dutifully, you ignore his cries and your own sticky arousal, refusing to falter until you get what you want. 
As he grows even harder beneath you, Caleb’s pleas grow more frantic. “Y/N, please. I-I’m sorry for last night, just—please. Fuck, please,” he stammers, a tremor in his voice. 
Just as the final plea leaves his mouth, an especially deep pothole throws you from his lap and a few inches into the air. A second later, gravity sends you crashing back down onto his aching, straining cock, and you feel it. Caleb comes hard, mouth dropping open in a silent scream, eyes closing in a mix of ecstasy and shame. To avoid suspicion, he buries his face into your shoulder while he rides out the rest of his high, pitiful whimpers and groans drowned out by the chords of cheerful pop songs on the radio. 
Reveling in the way Caleb’s whines vibrate through your skin, you turn your head slowly, checking your reflections in the rear-view mirror. When the coast is clear, you press a soft, teasing kiss to his hair, to which he twitches under you.
You’re filled with a wicked, awful glee, but you keep your face a mask of nonchalance as you call out, “Hey Gideon, can we stop at a gas station soon? I need to freshen up.”
Tumblr media
For the rest of the trip, the Caleb who’d been so proud to forbid you from going out couldn’t meet your gaze, flushing crimson every time he saw you. 
5K notes · View notes
clonewarsahsoka · 1 year ago
Text
I'm slowly becoming interested in computer science >.<
0 notes
arshikasingh · 1 year ago
Text
Types of Array in java
There are two types of array in Java which are as follows:
Tumblr media
1 note · View note
kakajoju · 1 year ago
Text
Had two exams last week that I felt I absolutely bombed so my mental state was..... not good for the past few days (I don't handle academic failure well, yeah).
Thankfully, they were lenient with the first one (that one set me off the hardest tbh) so I passed.
And in the second one I was one of the top scorers actually??? Lmao literally found it funny after I saw that 95/100 bcs I thought my score would be barely passing-
0 notes
fortunatelycoldengineer · 1 year ago
Text
Tumblr media
C language MCQ . . . . write your answer in the comment section https://bit.ly/48J8x0O You can check the answer at the above link at Q.no. 1
0 notes